package edu.scut.course_management.dao;

import java.util.List;

import org.apache.ibatis.annotations.Param;
import org.springframework.stereotype.Repository;

import edu.scut.course_management.po.Attachment;

/**
 * 数据访问，对应库表：attachment
 * 
 * @author huaming
 */
@Repository
public interface AttachmentMapper {
    
    // 创建新的附件记录，采用回填主键技术
    void addAttachmentList(List<Attachment> attachmentList);

    // 通过homeworkId来找对应的附件
    List<Attachment> findAttachmentsByHomeworkId(@Param("homeworkId")Integer homeworkId);

    // 通过answerId来找对应的附件
    List<Attachment> findAttachmentsByAnswerId(@Param("answerId")Integer answerId);
    
}
